home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / GameboyDev / GBDK / lib / clock.s < prev    next >
Text File  |  1999-03-29  |  462b  |  25 lines

  1.     ;; time.s
  2.     ;;
  3.     ;; Simple, not completly conformant implementation of time routines
  4.  
  5.     ;; Special routines to read the clock value without disabling interrupts
  6.  
  7.     ;; Defined in crt0.s
  8.  
  9.     .module clock.s
  10.     
  11.     .area    _CODE
  12.     .globl    .sys_time
  13. _clock::
  14. .clock::
  15.     LD    HL,#.sys_time+1
  16.     LD    D,(HL)
  17.     DEC    HL
  18.     LD    E,(HL)
  19.     INC    HL
  20.     CP    D        ; If theyre different, then E may be corrupt
  21.     RET    Z
  22.     LD    E,#0xFF        ; Corrupt - take the earlier value which must have
  23.                 ; been when E = 0xFF
  24.     RET
  25.